package sort.data;

import anaydis.sort.data.DataSetGenerator;
import org.jetbrains.annotations.NotNull;

import java.text.Collator;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;


public class StringDataSetGenerator implements DataSetGenerator<String> {
    private Locale instance;

    public StringDataSetGenerator(){
        instance = Locale.US;
    }

    public void setInstance (Locale instance){
        this.instance = instance;
    }

    @NotNull
    public List<String> createAscending(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public List<String> createDescending(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public List<String> createRandom(int i) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @NotNull
    public Comparator<String> getComparator() {
        return new Comparator<String>(){
            public int compare(String s, String s1) {
                Collator collator = Collator.getInstance(instance);
                return collator.compare(s,s1);
            }
        };
    }

    public Locale getInstance() {
        return instance;
    }
}
